<?php

namespace app\user\validate;

use app\common\validate\BaseValidate;

class UserValidate extends BaseValidate
{
    /**
     * 验证规则
     */
    protected $field = [
        'user_id'      => '',
        'username'     => '账号',
        'password'     => '密码',
        'mobile'       => '手机',
        'nickname'     => '昵称',
        'head_pic'     => '头像',
        'openid'       => '微信OPENID',
        'sex'          => '0=保密',
        'birthday'     => '生日',
        'user_type'    => '用户类型:1=正常用户;2=虚拟用户',
        'tjr'          => '推荐人ID',
        'last_ip'      => '最后登录ip',
        'login_time'   => '最后登录时间',
        'is_auth'      => '授权',
        'status'       => '0=禁用',
        'is_delete'    => '0=未删',
        'disable_time' => '禁用时间',
        'create_time'  => '创建日期',
        'update_time'  => '更新日期',

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'update' => [
            "user_id"=>'require',
            'nickname',
            'username',
            'mj_no',
            'mobile',
            'sex',
            'openid',
            'head_pic',
            'user_type'=>'in:1,2',
        ],
        'save'   => [
            'nickname'=>'require',
            'mj_no',
            'head_pic'=>'require',
            'user_type'=>'require|in:1,2',
        ],
    ];

    /**
     * 提示消息
     */
    protected $message = [

    ];


}
